<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>搜索 - 社交圈</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    :root {
      --primary: #3B82F6;
      --primary-light: #EFF6FF;
      --gray: #6C757D;
      --light-gray: #E5E7EB;
      --dark: #1F2937;
      --white: #FFFFFF;
      --light-bg: #F9FAFB;
      --red: #EF4444;
      --green: #10B981;
      --yellow: #F59E0B;
    }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background-color: var(--light-bg);
      color: var(--dark);
      padding-top: 56px;
      padding-bottom: 15px;
    }
    
    /* 顶部导航 */
    .navbar {
      background-color: var(--white);
      box-shadow: 0 2px 8px rgba(0,0,0,0.05);
      padding: 0.5rem 1rem;
    }
    
    .search-container {
      flex: 1;
      position: relative;
      max-width: 500px;
    }
    
    .search-input {
      width: 100%;
      padding: 8px 15px 8px 40px;
      border-radius: 20px;
      border: 1px solid var(--light-gray);
      background-color: var(--light-bg);
      font-size: 14px;
      transition: all 0.3s;
    }
    
    .search-input:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    }
    
    .search-icon {
      position: absolute;
      left: 15px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--gray);
      font-size: 16px;
    }
    
    /* 搜索分类标签 */
    .search-tabs {
      display: flex;
      overflow-x: auto;
      padding: 10px 15px;
      background-color: var(--white);
      border-bottom: 1px solid var(--light-gray);
      scrollbar-width: none;
    }
    
    .search-tabs::-webkit-scrollbar {
      display: none;
    }
    
    .search-tab {
      padding: 6px 15px;
      margin-right: 8px;
      border-radius: 20px;
      font-size: 14px;
      white-space: nowrap;
      cursor: pointer;
      transition: all 0.2s;
      color: var(--gray);
    }
    
    .search-tab.active {
      background-color: var(--primary-light);
      color: var(--primary);
      font-weight: 500;
    }
    
    /* 搜索结果容器 */
    .search-results {
      padding: 15px;
    }
    
    /* 结果头部 */
    .results-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 15px;
    }
    
    .results-count {
      font-size: 14px;
      color: var(--gray);
    }
    
    .sort-options {
      font-size: 14px;
    }
    
    .sort-options select {
      border: none;
      background: none;
      color: var(--primary);
      font-weight: 500;
      padding: 2px 0;
    }
    
    /* 通用结果项样式 */
    .result-section {
      margin-bottom: 25px;
    }
    
    .section-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
    }
    
    .section-title i {
      margin-right: 8px;
      color: var(--primary);
    }
    
    .result-list {
      display: grid;
      gap: 12px;
    }
    
    .result-item {
      background-color: var(--white);
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0,0,0,0.05);
      transition: transform 0.2s;
    }
    
    .result-item:hover {
      transform: translateY(-2px);
    }
    
    /* 文章结果样式 */
    .article-item {
      padding: 15px;
    }
    
    .article-title {
      font-weight: 600;
      font-size: 16px;
      margin-bottom: 8px;
      line-height: 1.4;
    }
    
    .article-excerpt {
      font-size: 14px;
      color: var(--gray);
      margin-bottom: 10px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      line-height: 1.5;
    }
    
    .article-meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12px;
      color: var(--gray);
    }
    
    .article-author {
      display: flex;
      align-items: center;
    }
    
    .author-avatar {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      margin-right: 6px;
      object-fit: cover;
    }
    
    .article-stats {
      display: flex;
      gap: 12px;
    }
    
    .article-stat {
      display: flex;
      align-items: center;
      gap: 4px;
    }
    
    /* 相册结果样式 */
    .album-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }
    
    .album-item {
      aspect-ratio: 1;
      position: relative;
      overflow: hidden;
      border-radius: 8px;
    }
    
    .album-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.3s;
    }
    
    .album-item:hover .album-img {
      transform: scale(1.05);
    }
    
    .album-info {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      background: linear-gradient(transparent, rgba(0,0,0,0.6));
      color: white;
      padding: 8px;
      font-size: 12px;
    }
    
    .album-count {
      position: absolute;
      top: 8px;
      right: 8px;
      background-color: rgba(0,0,0,0.5);
      color: white;
      border-radius: 10px;
      padding: 2px 6px;
      font-size: 11px;
    }
    
    /* 动态结果样式 */
    .post-item {
      padding: 15px;
    }
    
    .post-header {
      display: flex;
      margin-bottom: 10px;
    }
    
    .post-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      margin-right: 10px;
      object-fit: cover;
    }
    
    .post-author {
      font-weight: 500;
      font-size: 15px;
    }
    
    .post-time {
      font-size: 12px;
      color: var(--gray);
    }
    
    .post-content {
      font-size: 14px;
      margin-bottom: 10px;
      line-height: 1.5;
    }
    
    .post-images {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 5px;
      margin-bottom: 10px;
      border-radius: 8px;
      overflow: hidden;
    }
    
    .post-image {
      aspect-ratio: 1;
      object-fit: cover;
    }
    
    .post-actions {
      display: flex;
      justify-content: space-around;
      padding-top: 8px;
      border-top: 1px solid var(--light-gray);
      font-size: 13px;
      color: var(--gray);
    }
    
    .post-action {
      display: flex;
      align-items: center;
      gap: 5px;
    }
    
    /* 服务结果样式 */
    .service-item {
      display: flex;
      padding: 15px;
    }
    
    .service-icon {
      width: 50px;
      height: 50px;
      border-radius: 10px;
      background-color: var(--primary-light);
      color: var(--primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      margin-right: 12px;
    }
    
    .service-details {
      flex: 1;
    }
    
    .service-title {
      font-weight: 600;
      font-size: 15px;
      margin-bottom: 3px;
    }
    
    .service-desc {
      font-size: 13px;
      color: var(--gray);
      margin-bottom: 5px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    
    .service-meta {
      display: flex;
      gap: 10px;
      font-size: 12px;
    }
    
    .service-rating {
      color: var(--yellow);
      display: flex;
      align-items: center;
      gap: 2px;
    }
    
    .service-price {
      color: var(--red);
      font-weight: 500;
    }
    
    /* 招聘求职结果样式 */
    .job-item {
      padding: 15px;
      border-left: 3px solid var(--primary);
    }
    
    .job-type {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 12px;
      margin-right: 8px;
      background-color: var(--primary-light);
      color: var(--primary);
    }
    
    .job-title {
      font-weight: 600;
      font-size: 16px;
      margin-bottom: 8px;
    }
    
    .job-company {
      font-size: 14px;
      color: var(--dark);
      margin-bottom: 5px;
    }
    
    .job-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      font-size: 13px;
      color: var(--gray);
      margin-bottom: 8px;
    }
    
    .job-salary {
      color: var(--green);
      font-weight: 500;
    }
    
    .job-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }
    
    .job-tag {
      padding: 3px 8px;
      background-color: var(--light-bg);
      border-radius: 4px;
      font-size: 12px;
      color: var(--gray);
    }
    
    /* 空状态 */
    .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: var(--gray);
    }
    
    .empty-state i {
      font-size: 60px;
      margin-bottom: 15px;
      color: var(--light-gray);
    }
    
    .empty-state p {
      margin-bottom: 20px;
      font-size: 15px;
    }
    
    .empty-state .btn {
      background-color: var(--primary);
      color: white;
      border: none;
      padding: 8px 20px;
      border-radius: 20px;
    }
    
    /* 热门搜索 */
    .hot-searches {
      padding: 15px;
      background-color: var(--white);
      border-radius: 10px;
      margin-bottom: 20px;
    }
    
    .hot-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 12px;
      color: var(--dark);
    }
    
    .hot-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }
    
    .hot-tag {
      padding: 6px 15px;
      background-color: var(--light-bg);
      border-radius: 20px;
      font-size: 14px;
      color: var(--dark);
      white-space: nowrap;
      cursor: pointer;
    }
    
    .hot-tag:hover {
      background-color: var(--primary-light);
      color: var(--primary);
    }
    
    .hot-tag .fa-fire {
      color: var(--red);
      margin-right: 5px;
    }
  </style>
</head>
<body>
  <!-- 顶部导航 -->
  <nav class="navbar navbar-light fixed-top">
    <div class="container-fluid d-flex align-items-center">
      <a class="nav-link me-2" href="#" aria-label="返回">
        <i class="fa fa-arrow-left"></i>
      </a>
      <div class="search-container">
        <i class="fa fa-search search-icon"></i>
        <input type="text" class="search-input" placeholder="搜索文章、动态、服务、招聘..." value="设计">
      </div>
      <a class="nav-link ms-2" href="#" aria-label="取消">
        <span style="font-size: 15px;">取消</span>
      </a>
    </div>
  </nav>
  
  <!-- 搜索分类标签 -->
  <div class="search-tabs">
    <div class="search-tab active" data-type="all">全部</div>
    <div class="search-tab" data-type="article">文章</div>
    <div class="search-tab" data-type="album">相册</div>
    <div class="search-tab" data-type="post">动态</div>
    <div class="search-tab" data-type="service">服务</div>
    <div class="search-tab" data-type="job">招聘</div>
    <div class="search-tab" data-type="resume">求职</div>
  </div>
  
  <!-- 搜索结果容器 -->
  <div class="search-results">
    <!-- 热门搜索推荐 -->
    <div class="hot-searches">
      <div class="hot-title">热门搜索</div>
      <div class="hot-tags">
        <div class="hot-tag"><i class="fa fa-fire"></i>UI设计</div>
        <div class="hot-tag"><i class="fa fa-fire"></i>前端开发</div>
        <div class="hot-tag">产品经理</div>
        <div class="hot-tag">摄影</div>
        <div class="hot-tag">美食</div>
        <div class="hot-tag">旅行</div>
        <div class="hot-tag">健身</div>
        <div class="hot-tag">招聘信息</div>
      </div>
    </div>
    
    <!-- 文章结果 -->
    <div class="result-section" data-section="article">
      <div class="section-title">
        <i class="fa fa-file-text-o"></i>
        <span>相关文章</span>
      </div>
      <div class="result-list">
        <div class="result-item article-item">
          <div class="article-title">2023年最新UI设计趋势分析与实践指南</div>
          <div class="article-excerpt">本文详细介绍了2023年UI设计领域的主要趋势，包括极简主义的回归、3D元素的应用以及动效设计的创新方向，并提供了实用的设计实践建议...</div>
          <div class="article-meta">
            <div class="article-author">
              <img src="https://picsum.photos/100/100?random=1" alt="作者头像" class="author-avatar">
              <span>设计达人</span>
            </div>
            <div class="article-stats">
              <div class="article-stat">
                <i class="fa fa-eye"></i> 2.5k
              </div>
              <div class="article-stat">
                <i class="fa fa-comment-o"></i> 42
              </div>
              <div class="article-stat">
                <i class="fa fa-heart-o"></i> 128
              </div>
            </div>
          </div>
        </div>
        
        <div class="result-item article-item">
          <div class="article-title">从零开始学习交互设计：基础到进阶</div>
          <div class="article-excerpt">交互设计是用户体验的核心组成部分，本文从基础概念出发，逐步讲解交互设计的原则、方法和工具，帮助初学者快速入门并掌握实用技能...</div>
          <div class="article-meta">
            <div class="article-author">
              <img src="https://picsum.photos/100/100?random=2" alt="作者头像" class="author-avatar">
              <span>交互学院</span>
            </div>
            <div class="article-stats">
              <div class="article-stat">
                <i class="fa fa-eye"></i> 1.8k
              </div>
              <div class="article-stat">
                <i class="fa fa-comment-o"></i> 36
              </div>
              <div class="article-stat">
                <i class="fa fa-heart-o"></i> 95
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 相册结果 -->
    <div class="result-section" data-section="album">
      <div class="section-title">
        <i class="fa fa-image"></i>
        <span>相关相册</span>
      </div>
      <div class="album-grid">
        <div class="album-item">
          <img src="https://picsum.photos/300/300?random=10" alt="设计作品" class="album-img">
          <div class="album-info">UI设计作品集</div>
          <div class="album-count">12张</div>
        </div>
        <div class="album-item">
          <img src="https://picsum.photos/300/300?random=11" alt="设计灵感" class="album-img">
          <div class="album-info">设计灵感收集</div>
          <div class="album-count">24张</div>
        </div>
        <div class="album-item">
          <img src="https://picsum.photos/300/300?random=12" alt="设计工具" class="album-img">
          <div class="album-info">设计师工作台</div>
          <div class="album-count">8张</div>
        </div>
      </div>
    </div>
    
    <!-- 动态结果 -->
    <div class="result-section" data-section="post">
      <div class="section-title">
        <i class="fa fa-comment"></i>
        <span>相关动态</span>
      </div>
      <div class="result-list">
        <div class="result-item post-item">
          <div class="post-header">
            <img src="https://picsum.photos/100/100?random=20" alt="用户头像" class="post-avatar">
            <div>
              <div class="post-author">设计师小明</div>
              <div class="post-time">2小时前</div>
            </div>
          </div>
          <div class="post-content">分享一个最近完成的设计项目，客户要求简约风格但要有高级感，尝试了很多方案最终确定了这个版本，大家觉得怎么样？欢迎提建议！</div>
          <div class="post-images">
            <img src="https://picsum.photos/300/300?random=21" alt="设计作品" class="post-image">
            <img src="https://picsum.photos/300/300?random=22" alt="设计作品" class="post-image">
          </div>
          <div class="post-actions">
            <div class="post-action">
              <i class="fa fa-heart-o"></i> 32
            </div>
            <div class="post-action">
              <i class="fa fa-comment-o"></i> 15
            </div>
            <div class="post-action">
              <i class="fa fa-share"></i> 分享
            </div>
          </div>
        </div>
        
        <div class="result-item post-item">
          <div class="post-header">
            <img src="https://picsum.photos/100/100?random=23" alt="用户头像" class="post-avatar">
            <div>
              <div class="post-author">设计资源库</div>
              <div class="post-time">昨天 15:30</div>
            </div>
          </div>
          <div class="post-content">推荐几个高质量的设计资源网站，包含免费的图标、字体和UI组件，设计师必备！链接在评论区~</div>
          <div class="post-actions">
            <div class="post-action">
              <i class="fa fa-heart-o"></i> 156
            </div>
            <div class="post-action">
              <i class="fa fa-comment-o"></i> 42
            </div>
            <div class="post-action">
              <i class="fa fa-share"></i> 分享
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 服务结果 -->
    <div class="result-section" data-section="service">
      <div class="section-title">
        <i class="fa fa-briefcase"></i>
        <span>相关服务</span>
      </div>
      <div class="result-list">
        <div class="result-item service-item">
          <div class="service-icon">
            <i class="fa fa-paint-brush"></i>
          </div>
          <div class="service-details">
            <div class="service-title">专业UI/UX设计服务</div>
            <div class="service-desc">提供APP界面设计、网站设计、原型制作、交互设计等全套UI/UX解决方案</div>
            <div class="service-meta">
              <div class="service-rating">
                <i class="fa fa-star"></i> 4.9
              </div>
              <div class="service-price">¥2000起</div>
            </div>
          </div>
        </div>
        
        <div class="result-item service-item">
          <div class="service-icon">
            <i class="fa fa-camera"></i>
          </div>
          <div class="service-details">
            <div class="service-title">产品摄影与后期设计</div>
            <div class="service-desc">专业产品拍摄、图片精修、电商视觉设计，提升产品吸引力</div>
            <div class="service-meta">
              <div class="service-rating">
                <i class="fa fa-star"></i> 4.7
              </div>
              <div class="service-price">¥500起</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 招聘结果 -->
    <div class="result-section" data-section="job">
      <div class="section-title">
        <i class="fa fa-bullhorn"></i>
        <span>相关招聘</span>
      </div>
      <div class="result-list">
        <div class="result-item job-item">
          <div>
            <span class="job-type">全职</span>
            <div class="job-title">资深UI设计师</div>
          </div>
          <div class="job-company">科技有限公司</div>
          <div class="job-meta">
            <div>北京 · 3-5年 · 本科</div>
            <div class="job-salary">15k-25k/月</div>
          </div>
          <div class="job-tags">
            <span class="job-tag">UI设计</span>
            <span class="job-tag">交互设计</span>
            <span class="job-tag">Figma</span>
            <span class="job-tag">团队管理</span>
          </div>
        </div>
        
        <div class="result-item job-item">
          <div>
            <span class="job-type">兼职</span>
            <div class="job-title">平面设计实习生</div>
          </div>
          <div class="job-company">创意设计工作室</div>
          <div class="job-meta">
            <div>上海 · 应届 · 大专</div>
            <div class="job-salary">3k-5k/月</div>
          </div>
          <div class="job-tags">
            <span class="job-tag">平面设计</span>
            <span class="job-tag">PS</span>
            <span class="job-tag">AI</span>
            <span class="job-tag">实习</span>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 求职结果 -->
    <div class="result-section" data-section="resume">
      <div class="section-title">
        <i class="fa fa-user"></i>
        <span>相关求职</span>
      </div>
      <div class="result-list">
        <div class="result-item job-item" style="border-left-color: var(--green);">
          <div>
            <span class="job-type" style="background-color: #ECFDF5; color: var(--green);">求职</span>
            <div class="job-title">UI/UX设计师 | 3年经验</div>
          </div>
          <div class="job-company">期望地点：广州、深圳</div>
          <div class="job-meta">
            <div>本科 · 3年经验 · 已离职</div>
            <div class="job-salary" style="color: var(--green);">期望12k-18k/月</div>
          </div>
          <div class="job-tags">
            <span class="job-tag">UI设计</span>
            <span class="job-tag">原型设计</span>
            <span class="job-tag">用户研究</span>
            <span class="job-tag">Sketch</span>
          </div>
        </div>
        
        <div class="result-item job-item" style="border-left-color: var(--green);">
          <div>
            <span class="job-type" style="background-color: #ECFDF5; color: var(--green);">求职</span>
            <div class="job-title">视觉设计师 | 5年经验</div>
          </div>
          <div class="job-company">期望地点：北京、上海</div>
          <div class="job-meta">
            <div>本科 · 5年经验 · 在职考虑机会</div>
            <div class="job-salary" style="color: var(--green);">期望20k-30k/月</div>
          </div>
          <div class="job-tags">
            <span class="job-tag">视觉设计</span>
            <span class="job-tag">品牌设计</span>
            <span class="job-tag">插画</span>
            <span class="job-tag">动效</span>
          </div>
        </div>
      </div>
    </div>
  </div>
  
  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // 搜索分类切换
    const searchTabs = document.querySelectorAll('.search-tab');
    const resultSections = document.querySelectorAll('.result-section');
    
    searchTabs.forEach(tab => {
      tab.addEventListener('click', function() {
        // 更新标签状态
        searchTabs.forEach(t => t.classList.remove('active'));
        this.classList.add('active');
        
        const type = this.getAttribute('data-type');
        
        // 显示/隐藏对应结果
        resultSections.forEach(section => {
          if (type === 'all' || section.getAttribute('data-section') === type) {
            section.style.display = 'block';
          } else {
            section.style.display = 'none';
          }
        });
      });
    });
    
    // 搜索输入处理
    const searchInput = document.querySelector('.search-input');
    const cancelBtn = document.querySelector('.nav-link.ms-2');
    
    // 搜索输入事件
    searchInput.addEventListener('keypress', function(e) {
      if (e.key === 'Enter') {
        performSearch(this.value);
      }
    });
    
    // 取消按钮事件
    cancelBtn.addEventListener('click', function(e) {
      e.preventDefault();
      searchInput.value = '';
      // 显示默认搜索状态
      document.querySelector('.hot-searches').style.display = 'block';
      resultSections.forEach(section => {
        section.style.display = 'block';
      });
    });
    
    // 热门标签点击事件
    const hotTags = document.querySelectorAll('.hot-tag');
    hotTags.forEach(tag => {
      tag.addEventListener('click', function() {
        const searchText = this.textContent.replace(/^.*?(\S+)$/, '$1'); // 提取标签文本（去掉火焰图标）
        searchInput.value = searchText;
        performSearch(searchText);
      });
    });
    
    // 执行搜索函数
    function performSearch(query) {
      if (!query.trim()) return;
      
      // 隐藏热门搜索
      document.querySelector('.hot-searches').style.display = 'none';
      
      // 模拟搜索加载效果
      resultSections.forEach(section => {
        section.innerHTML = `
          <div class="section-title">
            <i class="${section.querySelector('.section-title i').className}"></i>
            <span>${section.querySelector('.section-title span').textContent}</span>
          </div>
          <div style="text-align: center; padding: 20px 0;">
            <i class="fa fa-spinner fa-spin" style="font-size: 20px; color: var(--gray);"></i>
            <p style="margin-top: 10px; font-size: 14px; color: var(--gray);">正在搜索 "${query}" 相关内容...</p>
          </div>
        `;
      });
      
      // 模拟搜索结果加载完成
      setTimeout(() => {
        // 实际应用中这里会根据搜索词从服务器获取结果
        // 这里仅做演示，恢复原始内容
        location.reload();
      }, 1500);
    }
    
    // 排序功能
    const sortSelects = document.querySelectorAll('.sort-options select');
    sortSelects.forEach(select => {
      select.addEventListener('change', function() {
        const sortType = this.value;
        const section = this.closest('.result-section');
        alert(`已按${sortType}排序`);
        // 实际应用中这里会实现排序逻辑
      });
    });
  </script>
</body>
</html>